﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SyOrderStateEntity
{
    public class SyOrderStateFactory : ISyOrderStateFactory
    {
        private static readonly Lazy<SyOrderStateFactory> lazy = new Lazy<SyOrderStateFactory>(() => new SyOrderStateFactory());
        private SyOrderStateFactory() { }
        public static SyOrderStateFactory Instance { get { return lazy.Value; } }
        public SyOrderState GetSyOrderState(ISyOrder syOrder, SyStateContext stateContext)
        {
            return SyOrderStateHandler.GetDelegateSyOrderState(syOrder.SyOrderStatus)(syOrder, stateContext);
        }
    }
}
